<?php
/**
* @package plugin itemtype for Pages-and-Items
* @version 1.0.4
* @copyright Copyright (C) 2006-2008 Carsten Engel. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @author http://www.pages-and-items.com
* @joomla Joomla is Free Software
*/

//no direct access
if(!defined('_VALID_MOS') && !defined('_JEXEC')){
	die('Restricted access');
}

?>
<table class="adminlist">			
	<tr>
		<th colspan="2">&nbsp;					
			
		</th>
	</tr>	
	<tr>					
		<td class="b" colspan="2"><span class="sidestep"><?php echo _pi_lang_default; ?></span><span class="sidestep"><?php echo _pi_lang_name; ?></span><span class="sidestep"><?php echo $pi_lang_plugin['sizes']; ?></span>
		
		</td>
	</tr>	
	<?php
	
		$sizes = explode(',',$pi_plugin_config['sizes']);
		for($n = 0; $n < count($sizes); $n++){			
			$size_row = explode(';',$sizes[$n]);
			$size_label = $size_row[0];
			$size_value = $size_row[1];			
			echo '<tr>';
			echo '<td colspan="2">';
			echo '<span class="sidestep">';
			echo '<input name="default_size" type="radio" value="'.$size_value.'"';
			if($pi_plugin_config['default_size']==$size_value){
				echo 'checked="checked"';
			}
			echo ' />';
			echo '</span>';
			echo '<span class="sidestep">';
			echo '<input type="text" value="'.$size_label.'" name="sizes[m'.$n.'][name]" />';
			echo '</span>';
			echo '<span class="sidestep">';	
			echo '<input type="text" value="'.$size_value.'" name="sizes[m'.$n.'][width_height]" />';			
			echo '</span>';
			echo '</td>';
			echo '</tr>';
		}
		//2 extra rows for extra fields
		for($p = $n; $p < $n+3; $p++){			
			echo '<tr>';
			echo '<td colspan="2">';
			echo '<span class="sidestep">';
			echo '&nbsp;';
			echo '</span>';
			echo '<span class="sidestep">';
			echo '<input type="text" value="" name="sizes[m'.$p.'][name]" />';
			echo '</span>';
			echo '<span class="sidestep">';	
			echo '<input type="text" value="" name="sizes[m'.$p.'][width_height]" />';			
			echo '</span>';
			echo '</td>';
			echo '</tr>';
		}
			
	?>
	
</table>	